/*
 * PopupSubmitCanvassMsg.hpp
 *
 *  Created on: Jul 16, 2012
 *      Author: guillou
 */

#ifndef POPUPSUBMITCANVASSMSG_HPP_
#define POPUPSUBMITCANVASSMSG_HPP_

#include <PopupLibTypes.hpp>
#include "PopupAbstractMessage.hpp"

namespace Popup
{
  struct CanvassSubmitMsg : public AbstractMessage, public Canvass
  {
    enum
    {
      ID,
      SENDER,
      TARGETS,
      QUESTION,
      CHOICES,
      TIMEOUT,
      ANONYMOUS,
      ALLOW_MULTISELECTION
    };

    //! Constructor used in order to send a message
    CanvassSubmitMsg(const Canvass & p_canvass) :
      AbstractMessage(POPUP_MSG_TYPE_CANVASS_SUBMIT), canvass(p_canvass) {}

    //! Constructor used in order to receive a message
    CanvassSubmitMsg(const Message *p_message);

    virtual ~CanvassSubmitMsg() {}

    //! @Override
    bool onSend();

    //! @Override
    bool onReceive();

  private:
    Canvass canvass;
  };
}

#endif /* POPUPSUBMITCANVASSMSG_HPP_ */
